package websocketInit

import (
	"gin_chat_demo/websocket"
	"gin_chat_demo/websocket/handler"
	"time"
)

func InitWebsocket(addr string) {
	srv := websocket.NewServer(addr, websocket.WithServerMaxConnectionIdle(5*time.Second))
	defer srv.Stop()
	handler.RegisterHandlers(srv)
	go srv.Start()
}
